package main

import (
	"fmt"
	"time"
)

func main() {
	ch := make(chan int)
	quit := make(chan bool)
	go func() {
		for true {
			select {
			case num := <-ch:
				fmt.Println("num=", num)
			case tt := <-time.After(time.Second * 5):
				fmt.Println("tt=", tt)
				quit <- false
			}
		}
	}()
	qq := <-quit
	fmt.Println("qq=", qq)
}
